home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Chat & Communication
/
Digsby build 37
/
digsby_setup.exe
/
lib
/
msn
/
p9
/
MSNP9Switchboard.pyo
(
.txt
)
< prev
Wrap
Python Compiled Bytecode
|
2008-10-13
|
2KB
|
40 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
from util import callsback
import msn
from msn.p8 import Switchboard as Super
defcb = dict(trid = True, callback = sentinel)
class MSNP9Switchboard(Super):
events = Super.events | set(('send_p2p_msg', 'recv_p2p_msg'))
def send_p2p_message(self, to, data, callback):
body = MSNP2PMessage(to, data)
cmd = msn.MSNCommands.MSG('D', payload = str(body))
self.socket.send(cmd, trid = True, callback = callback)
self.event('send_p2p_msg', body)
def recv_msg_p2p(self, msg):
self.event('recv_p2p_msg', msg.args[0], msg.payload.body())
class MSNP2PMessage(object):
def __init__(self, recvr, body):
self.recvr = recvr
self.body = body
def __str__(self):
return '\r\n'.join([
'MIME-Version: 1.0',
'Content-Type: application/x-msnmsgrp2p',
'P2P-Dest: %(recvr)s',
'',
'%(body)s']) % vars(self)